package com.estate.system.domain.vo;

import com.estate.system.domain.report.boss.PropertyTypeDistribution;
import com.estate.system.domain.report.boss.TransactionTypeDistribution;
import com.estate.system.domain.report.boss.listing.PriceRangeDistribution;
import com.estate.system.domain.report.boss.listing.TransactionPropertyHeatmap;

import java.util.ArrayList;
import java.util.List;

// 房产数据可视化分析生成器
public class PropertyVisualizationGenerator {

    /**
     * 生成房产类型分布数据的List
     *
     * @return 包含房产类型分布信息的List
     */
    public static List<PropertyTypeDistribution> generatePropertyTypeData() {
        List<PropertyTypeDistribution> propertyData = new ArrayList<>();

        // 根据图片内容添加房产类型分布数据
        propertyData.add(new PropertyTypeDistribution("Villa", 67.65));
        propertyData.add(new PropertyTypeDistribution("Apartment", 2.94));
        propertyData.add(new PropertyTypeDistribution("Flat", 5.88));
        propertyData.add(new PropertyTypeDistribution("House", 2.94));
        propertyData.add(new PropertyTypeDistribution("Studio", 2.94));
        propertyData.add(new PropertyTypeDistribution("Townhouse", 2.94));

        return propertyData;
    }

    /**
     * 生成交易类型分布数据的List
     *
     * @return 包含交易类型分布信息的List
     */
    public static List<TransactionTypeDistribution> generateTransactionTypeData() {
        List<TransactionTypeDistribution> transactionData = new ArrayList<>();

        // 根据图片内容添加交易类型分布数据
        transactionData.add(new TransactionTypeDistribution("Lease", 8.82));
        transactionData.add(new TransactionTypeDistribution("Private Sale", 23.53));
        transactionData.add(new TransactionTypeDistribution("Auction", 23.53));

        return transactionData;
    }

    /**
     * 生成价格区间分布数据的List
     *
     * @return 包含价格区间分布信息的List
     */
    public static List<PriceRangeDistribution> generatePriceRangeData() {
        List<PriceRangeDistribution> priceData = new ArrayList<>();

        // 根据图片内容添加价格区间分布数据
        priceData.add(new PriceRangeDistribution("$500-$1K", 32.0, 32));
        // 假设其他价格区间（图片中未明确显示）
        priceData.add(new PriceRangeDistribution("$1K-$1.5K", 25.0, 25));
        priceData.add(new PriceRangeDistribution("$1.5K-$2K", 18.0, 18));
        priceData.add(new PriceRangeDistribution("$2K+", 25.0, 25));

        return priceData;
    }

    /**
     * 生成交易类型与房产类型热力图数据的List
     *
     * @return 包含热力图信息的List
     */
    public static List<TransactionPropertyHeatmap> generateHeatmapData() {
        List<TransactionPropertyHeatmap> heatmapData = new ArrayList<>();

        // 根据图片内容添加热力图数据
        // Auction 交易类型
        heatmapData.add(new TransactionPropertyHeatmap("Auction", "House", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Auction", "Studio", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Auction", "Townhouse", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Auction", "Unit", 1));

        // Lease 交易类型
        heatmapData.add(new TransactionPropertyHeatmap("Lease", "House", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Lease", "Studio", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Lease", "Townhouse", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Lease", "Unit", 30));

        // Private Sale 交易类型
        heatmapData.add(new TransactionPropertyHeatmap("Private Sale", "House", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Private Sale", "Studio", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Private Sale", "Townhouse", 0));
        heatmapData.add(new TransactionPropertyHeatmap("Private Sale", "Unit", 16));

        return heatmapData;
    }
}